<?php


namespace api\modules\v1\controllers\customer;

use api\controllers\OnAuthController;
use common\helpers\CommonHelper;
use Yii;

class SmsController extends OnAuthController
{
    public $modelClass = '';

    /**
     * @api {get} /v1/customer/sms/sms-list
     * @apiName 短信列表
     * @apiGroup
     * @apiParam {Number}
     * @apiParam {String}
     * @author loujie
     */
    public function actionSmsList()
    {
        $params = Yii::$app->request->get();

        return CommonHelper::dengta_request('/v1/baiyou/sms-list', $params);
    }

    /**
     * @api {post} /v1/customer/sms/sms-del
     * @apiName
     * @apiGroup
     * @apiParam {Number}
     * @apiParam {String}
     * @author loujie
     */
    public function actionSmsDel()
    {
        $params = Yii::$app->request->post();

        return CommonHelper::dengta_request('/v1/baiyou/sms-del', [], $params);
    }

    /**
     * @api {get} /v1/customer/sms/voice-list 通话记录
     * @apiName voice-list
     * @apiGroup Sms
     *
     * @apiParam {Number} type                                      呼叫类型
     * @apiParam {String} keyword                                   关键词
     * @apiParam {String} start_time                                拨号开始时间【格式：2020-01-01】
     * @apiParam {String} end_time                                  拨号结束时间【格式：2020-01-01】
     * @apiParam {Number} accountid                                 设备归属人ID
     * @apiParam {String} order_colum                               排序字段【duration：通话时长】
     * @apiParam {String} order_sort                                排序值【asc正序、desc倒序】
     *
     * @apiSuccess {Object}  data                                   返回数据
     * @apiSuccess {Number}  data.page                              当前页码
     * @apiSuccess {Number}  data.pageSize                          每页显示数
     * @apiSuccess {Number}  data.total                             总数
     */
    public function actionVoiceList()
    {
        $params = Yii::$app->request->get();
        return CommonHelper::dengta_request('/v1/baiyou/voice-list', $params);
    }
}
